//
//  MYNewsModel.m
//  MuYing
//
//  Created by tbb on 2020/2/12.
//  Copyright © 2020 TBB. All rights reserved.
//

#import "MYNewsModel.h"

@implementation MYNewsModel
+ (NSDictionary *)modelCustomPropertyMapper {
    return @{@"Id"  : @"id"};
}

+ (nullable NSDictionary<NSString *, id> *)modelContainerPropertyGenericClass {
    return @{@"informationAttrValueList":[MYNewsInformationAttrValueModel class]
    };
}

-(NSString *)showMi {
    if(!_showMi) {
        NSInteger mi = [self.mi integerValue];
        if (mi > 1000) {
            _showMi = [NSString stringWithFormat:@"%@%.1lfkm",kYQLS(@"距离您当前位置"),mi/1000.0];
        }else{
            _showMi = [NSString stringWithFormat:@"%@%zdm",kYQLS(@"距离您当前位置"),mi];
        }
    }
    return _showMi;
}


-(NSString *)createTimeStr {
    if (!_createTimeStr) {
        _createTimeStr = [NSDate timeToDateStr:[self.createTime doubleValue]];
    }
    return _createTimeStr;
}

@end
@implementation MYNewsInformationAttrValueModel

+ (NSDictionary *)modelCustomPropertyMapper {
    return @{@"Id"  : @"id"};
}


@end

